package com.lu.integrate.message.center.feign;

import com.lu.integrate.message.center.model.request.MessageCenterQueueMessageConfirmSubmitRequest;
import com.lu.integrate.message.center.model.request.MessageCenterQueueProduceRequest;
import com.lu.stack.common.model.constants.SystemApplication;
import com.lu.stack.common.model.response.R;
import com.lu.stack.nacos.feign.fallback.FeignToArticleFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author zhanglu
 * @project lu-cloud-stack
 * @description
 * @date 2023/2/13 18:10
 */
@FeignClient(name = SystemApplication.LU_STACK_MESSAGE_CENTER, path = "/message-center", fallback= FeignToArticleFallback.class)
public interface FeignToMessageCenter {

    /**
     * 消息发送生产者保存
     * @param queueHandler
     * @return
     */
    @PostMapping("/queue/producer")
    R queueProducer(@RequestBody MessageCenterQueueProduceRequest queueHandler);

    /**
     * 消息消费完毕，确认提交
     * @param request
     * @return
     */
    @PostMapping("/queue/confirm-submit")
    R confirmSubmit(@RequestBody @Validated MessageCenterQueueMessageConfirmSubmitRequest request);

}
